<?php

/**
 * This is the model class for table "saranaibadah".
 *
 * The followings are the available columns in table 'saranaibadah':
 * @property integer $si_id
 * @property integer $si_kec
 * @property integer $si_masjid
 * @property integer $si_langgar
 * @property integer $si_mushola
 * @property integer $si_gereja
 * @property integer $si_kelenteng
 * @property integer $si_pura
 * @property integer $si_kuil
 * @property integer $si_tahun
 */
class Saranaibadah extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Saranaibadah the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'saranaibadah';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('si_kec, si_masjid, si_langgar, si_mushola, si_gereja, si_kelenteng, si_pura, si_kuil, si_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('si_id, si_kec, si_masjid, si_langgar, si_mushola, si_gereja, si_kelenteng, si_pura, si_kuil, si_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'si_id' => 'Si',
			'si_kec' => 'Kecamatan',
			'si_masjid' => 'Masjid',
			'si_langgar' => 'Langgar',
			'si_mushola' => 'Mushola',
			'si_gereja' => 'Gereja',
			'si_kelenteng' => 'Kelenteng',
			'si_pura' => 'Pura',
			'si_kuil' => 'Kuil',
			'si_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('si_id',$this->si_id);
		$criteria->compare('si_kec',$this->si_kec);
		$criteria->compare('si_masjid',$this->si_masjid);
		$criteria->compare('si_langgar',$this->si_langgar);
		$criteria->compare('si_mushola',$this->si_mushola);
		$criteria->compare('si_gereja',$this->si_gereja);
		$criteria->compare('si_kelenteng',$this->si_kelenteng);
		$criteria->compare('si_pura',$this->si_pura);
		$criteria->compare('si_kuil',$this->si_kuil);
		$criteria->compare('si_tahun',$this->si_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}